//server
//
//Ky Halverson

#include"masterSocket.cpp"
#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <errno.h>
#include <signal.h>
#include <unistd.h>
#include <string.h>
#include <netinet/in.h>

#define PORT 2038
#define TYPE "UDP"


using namespace std;

int main()
{
	masterSocket* serverSocket;
	serverSocket = new masterSocket(PORT, TYPE);
	string message;
	 
	
	
		while(true)
		{

			message = serverSocket->recvIt("SERVER");
			if (message == "Exit")
			{
				break;
			}
			std::cout<<"I learned "<<message<<std::endl;
			serverSocket->sendIt("SERVER", "I didn't know that, or I forgot about it, thanks!");

		}
	







return 0; 
}
